define(["app", "angular", "services/BaseService"], function(app, angular) {
	
	var deps = ["$http", "BaseService"];
	
	function yokiKeyResource($http, BaseService) {
        return initResource($http, BaseService.restfulUrl + "key/", BaseService.formHeader);
    }
	
	var postHeader = {
	        "Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	
	function initResource($http, preUrl,formHeader) {
        return {
        	save: function (keyVo) {
				return $http.post(preUrl + "register", angular.toJson(keyVo));
			},
            deleteKey:function(keyId){
                return $http.get(preUrl +keyId+ "/deleteKey");
            },
            queryKeyList: function (pageNo,pageSize) {
                return $http.get(preUrl + "queryKeyList", {
                    params: {
                        pageSize: pageSize || 10000,
                        pageNo: pageNo || 1
                    }
                });
            },
        };
        
    }
	yokiKeyResource.$inject = deps;
	app.lazy.factory("AddYokiKeyResource", yokiKeyResource);
});
